//
//  DrawingLayer.m
//  TabulaImaginarius2
//
//  Created by TA2 on 5/16/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "DrawingLayer.h"

@implementation DrawingLayer

@synthesize	paths;
@synthesize newPaths;
@synthesize	visibleToAllPlayers;
@synthesize	visibleToPlayers;

- (id)init {
	paths = [[NSMutableArray alloc] init];
	newPaths = [[NSMutableArray alloc] init];
	visibleToAllPlayers = YES;
	return self;
}

- (void)dealloc {
    [paths release];
    paths = nil;
    [newPaths release];
    newPaths = nil;
    [visibleToPlayers release];
    visibleToPlayers = nil;
    [super dealloc];
}

- (void)encodeWithCoder:(NSCoder *)coder {
    [coder encodeObject:paths forKey:@"drawingLayerPaths"];
    [coder encodeObject:newPaths forKey:@"drawingLayerNewPaths"];
    [coder encodeBool:visibleToAllPlayers forKey:@"drawingLayerVisibleToAll"];
    [coder encodeObject:visibleToPlayers forKey:@"drawingLayerVisibleTo"];
}

- (id)initWithCoder:(NSCoder *)coder {
    self = [super init];
    self.paths = [coder decodeObjectForKey:@"drawingLayerPaths"];
    self.newPaths = [coder decodeObjectForKey:@"drawingLayerNewPaths"];
    self.visibleToAllPlayers = [coder decodeBoolForKey:@"drawingLayerVisibleToAll"];
    self.visibleToPlayers = [coder decodeObjectForKey:@"drawingLayerVisibleTo"];
    return self;
}

@end
